//
//  CollectionViewCellOfSongRecommend.m
//  UI_homework_22_QQ音乐界面和阿里星球界面
//
//  Created by li cheng on 16/8/13.
//  Copyright © 2016年 li cheng. All rights reserved.
//

#import "CollectionViewCellOfSongRecommend.h"

@interface CollectionViewCellOfSongRecommend()
@property (nonatomic, strong) UILabel *bigLabel;
@property (nonatomic, strong) UILabel *smalllabel;
@property (nonatomic, strong) UIImageView *myImageView;
@end
@implementation CollectionViewCellOfSongRecommend
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        _bigLabel = [[UILabel alloc] init];
        _bigLabel.backgroundColor = [UIColor blueColor];
        [self.contentView addSubview:_bigLabel];
        _smalllabel = [[UILabel alloc] init];
        _smalllabel.backgroundColor = [UIColor purpleColor];
        [self.contentView addSubview:_smalllabel];
        _myImageView = [[UIImageView alloc] init];
        _myImageView.backgroundColor = [UIColor orangeColor];
        [self.contentView addSubview:_myImageView];
    }
    return self;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    CGFloat edge = 5;
    // contentView 的宽高
    CGFloat widthOfContentView = self.contentView.bounds.size.width;
    CGFloat heightOfContentView = self.contentView.bounds.size.height;
    // bigLabel 的宽高
    CGFloat widthOfBigLabel = widthOfContentView * 4 / 5 - edge;
    CGFloat heightOfBigLabel = heightOfContentView / 4;
    _bigLabel.frame = CGRectMake(edge, heightOfBigLabel, widthOfBigLabel, heightOfBigLabel);
    // smallLabel 的宽高
    CGFloat widthOfSmallLabel = widthOfBigLabel;
    CGFloat heightOfSmallLabel = heightOfBigLabel;
    _smalllabel.frame = CGRectMake(edge, heightOfBigLabel * 2, widthOfSmallLabel, heightOfSmallLabel);
    // imageView 的宽高
    CGFloat heightOfIamgeView = heightOfContentView / 3;
    CGFloat widthOfImageView = heightOfIamgeView;
    _myImageView.frame = CGRectMake(widthOfContentView * 4 / 5, heightOfIamgeView, widthOfImageView, heightOfIamgeView);
    
    
    
    
    
    
    
    
    
}
@end
